# -*- coding: utf-8 -*-
"""
date: Fri Dec 14 10:36:50 2018
python: Anaconda 3.6.5
author: kanade
email: kanade@blisst.cn
"""
import matplotlib.pyplot as mp
import matplotlib.gridspec as mg


mp.figure('Grid Layout', facecolor='lightgray')
gs = mg.GridSpec(3, 3)
# 第0行，0,1两列
mp.subplot(gs[0, :2])
mp.xticks(())
mp.yticks(())
# 顾名思义，绘制文本 ，（0.5,0.5）是绘制文本的坐标，
# 虽然隐藏了刻度，但刻度默认是1x1的，左下角为0
# alpha是文本透明度
mp.text(0.5, 0.5, '1', ha='center', va='center',
        size=36, alpha=0.5)
# 第1,2行，0列
mp.subplot(gs[1:, 0])
mp.xticks(())
mp.yticks(())
mp.text(0.5, 0.5, '2', ha='center', va='center',
        size=36, alpha=0.5)
# 第2行，1,2列
mp.subplot(gs[2, 1:])
mp.xticks(())
mp.yticks(())
mp.text(0.5, 0.5, '3', ha='center', va='center',
        size=36, alpha=0.5)
# 第0,1行，2列
mp.subplot(gs[:2, 2])
mp.xticks(())
mp.yticks(())
mp.text(0.5, 0.5, '4', ha='center', va='center',
        size=36, alpha=0.5)
# 第1行，1列
mp.subplot(gs[1, 1])
mp.xticks(())
mp.yticks(())
mp.text(0.5, 0.5, '5', ha='center', va='center',
        size=36, alpha=0.5)

mp.tight_layout()
mp.show()
